// 组件状态

import React from 'react'
import ReactDOM from 'react-dom'

class Hello extends React.Component {
  state = {
    isLoading: true,
    count: 100
  }

  // constructor() {
  //   this.state = {}
  // }

  render() {
    return (
      <div>
        <h1>Counter：{this.state.count}</h1>
        <button onClick={() => this.setState({ count: this.state.count + 1 })}>
          +1
        </button>
      </div>
    )
  }
}

// 渲染
ReactDOM.render(<Hello />, document.getElementById('root'))
